<!DOCTYPE html><html lang="zh-CN"><head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>weekdays | Moment.js &#x6587;&#x6863;</title>
  <link rel="stylesheet" href="static/css/style.css">
  <link rel="shortcut icon" href="http://momentjs.cn/static/img/moment-favicon.png">
  <link rel="stylesheet" href="static/css/atom-one-light.min.css">
</head>
<body class="is-moment">
  <div class="hero hero-oneline">
    <div class="hero-centered">
      <h1>weekdays</h1>
    </div>
  </div>
  <div id="api-section-__FILENAME__">
    <div id="content" class="clearfix">
  
      <div id="column1" data-id="__ID__" class="interior">
        <header>
          <!-- <h1>weekdays</h1> -->
          <div id="gtoc">
            <ul>
              <!-- <li>v</li> -->
              <li>
                <a href="index.html#/customization/weekday-names/" name="toc">&#x8FD4;&#x56DE;&#x4E0A;&#x5C42;&#x6587;&#x6863;</a>
              </li>
              <li style="border: none;">
                <a href="javascript:window.open('https://github.com/momentjscn/moment-docs-cn/edit/master/moment/07-customization/03-weekday-names.md');" rel="nofollow" target="_blank">&#x63D0;&#x4EA4;&#x4FEE;&#x6539;</a>
              </li>
              <!-- <li>
                <a href="/search__SEARCH_PARAM__" name="toc">搜索</a>
              </li> -->
            </ul>
          </div>
          <hr>
        </header>

        <div id="biz_item"></div>
  
        <div id="apicontent">
          <div id="content_left">
							<div class="docs-method-signature">
								<pre><code class="language-js">// &#x4ECE; 2.12.0 &#x7248;&#x672C;&#x5F00;&#x59CB;
moment.updateLocale(&apos;en&apos;, {
    weekdays : String[]
});
moment.updateLocale(&apos;en&apos;, {
    weekdays : Function
});
moment.updateLocale(&apos;en&apos;, {
    weekdays : {
        standalone : String[],
        format : String[],
        isFormat : RegExp
    }
});
// &#x4ECE; 2.11.0 &#x7248;&#x672C;&#x5F00;&#x59CB;
moment.locale(&apos;en&apos;, {
    weekdays : {
        standalone : String[],
        format : String[],
        isFormat : Boolean
    }
});
// &#x4ECE; 2.8.1 &#x81F3; 2.11.2 &#x7248;&#x672C;
moment.locale(&apos;en&apos;, {
    weekdays : String[]
});
moment.locale(&apos;en&apos;, {
    weekdays : Function
});

// &#x5E9F;&#x5F03;&#x4E8E; 2.8.1 &#x7248;&#x672C;
moment.lang(&apos;en&apos;, {
    weekdays : String[]
});
moment.lang(&apos;en&apos;, {
    weekdays : Function
});
</code></pre>

							</div>
<p><code>Locale#weekdays</code> &#x5E94;&#x662F;&#x5DE5;&#x4F5C;&#x65E5;&#x540D;&#x79F0;&#x7684;&#x6570;&#x7EC4;&#x3002;</p>
<pre><code class="language-javascript">moment.updateLocale(&apos;en&apos;, {
    weekdays : [
        &quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;
    ]
});
</code></pre>
<p><code>Locale#weekdays</code> &#x4E5F;&#x53EF;&#x4EE5;&#x662F;&#x56DE;&#x8C03;&#x51FD;&#x6570;&#x3002;</p>
<pre><code class="language-javascript">moment.updateLocale(&apos;en&apos;, {
    weekdays : function (momentToFormat, format) {
        return weekdays[momentToFormat.day()];
    }
});
</code></pre>
<p>&#x6CE8;&#x610F;&#xFF1A;&#x4ECE; <strong>2.11.0</strong> &#x7248;&#x672C;&#x5F00;&#x59CB;&#xFF0C;format/standalone &#x7528;&#x4F8B;&#x4E5F;&#x53EF;&#x4EE5;&#x4F20;&#x5165;&#x3002;
<code>isFormat</code> &#x5C06;&#x4F1A;&#x7528;&#x4E8E;&#x5B8C;&#x6574;&#x7684;&#x683C;&#x5F0F;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x4EE5;&#x5224;&#x65AD;&#x8981;&#x4F7F;&#x7528;&#x7684;&#x683C;&#x5F0F;&#x3002;</p>
<pre><code class="language-javascript">moment.updateLocale(&apos;en&apos;, {
    weekdays : {
        standalone: &apos;&#x412;&#x43E;&#x441;&#x43A;&#x440;&#x435;&#x441;&#x435;&#x43D;&#x44C;&#x435;_&#x41F;&#x43E;&#x43D;&#x435;&#x434;&#x435;&#x43B;&#x44C;&#x43D;&#x438;&#x43A;_&#x412;&#x442;&#x43E;&#x440;&#x43D;&#x438;&#x43A;_&#x421;&#x440;&#x435;&#x434;&#x430;_&#x427;&#x435;&#x442;&#x432;&#x435;&#x440;&#x433;_&#x41F;&#x44F;&#x442;&#x43D;&#x438;&#x446;&#x430;_&#x421;&#x443;&#x431;&#x431;&#x43E;&#x442;&#x430;&apos;.split(&apos;_&apos;),
        format: &apos;&#x412;&#x43E;&#x441;&#x43A;&#x440;&#x435;&#x441;&#x435;&#x43D;&#x44C;&#x435;_&#x41F;&#x43E;&#x43D;&#x435;&#x434;&#x435;&#x43B;&#x44C;&#x43D;&#x438;&#x43A;_&#x412;&#x442;&#x43E;&#x440;&#x43D;&#x438;&#x43A;_&#x421;&#x440;&#x435;&#x434;&#x443;_&#x427;&#x435;&#x442;&#x432;&#x435;&#x440;&#x433;_&#x41F;&#x44F;&#x442;&#x43D;&#x438;&#x446;&#x443;_&#x421;&#x443;&#x431;&#x431;&#x43E;&#x442;&#x443;&apos;.split(&apos;_&apos;),
        isFormat: /\[ ?[&#x412;&#x432;] ?(?:&#x43F;&#x440;&#x43E;&#x448;&#x43B;&#x443;&#x44E;|&#x441;&#x43B;&#x435;&#x434;&#x443;&#x44E;&#x449;&#x443;&#x44E;|&#x44D;&#x442;&#x443;)? ?\] ?dddd/
    }
});
</code></pre>
					</div>
          <div id="content_right">
							<div class="docs-method-signature">
								<pre><code class="language-js">// From version 2.12.0 onward
moment.updateLocale(&apos;en&apos;, {
    weekdays : String[]
});
moment.updateLocale(&apos;en&apos;, {
    weekdays : Function
});
moment.updateLocale(&apos;en&apos;, {
    weekdays : {
        standalone : String[],
        format : String[],
        isFormat : RegExp
    }
});
// From version 2.11.0
moment.locale(&apos;en&apos;, {
    weekdays : {
        standalone : String[],
        format : String[],
        isFormat : Boolean
    }
});
// From version 2.8.1 to 2.11.2
moment.locale(&apos;en&apos;, {
    weekdays : String[]
});
moment.locale(&apos;en&apos;, {
    weekdays : Function
});

// Deprecated version 2.8.1
moment.lang(&apos;en&apos;, {
    weekdays : String[]
});
moment.lang(&apos;en&apos;, {
    weekdays : Function
});
</code></pre>

							</div>
<p><code>Locale#weekdays</code> should be an array of the weekdays names.</p>
<pre><code class="language-javascript">moment.updateLocale(&apos;en&apos;, {
    weekdays : [
        &quot;Sunday&quot;, &quot;Monday&quot;, &quot;Tuesday&quot;, &quot;Wednesday&quot;, &quot;Thursday&quot;, &quot;Friday&quot;, &quot;Saturday&quot;
    ]
});
</code></pre>
<p><code>Locale#weekdays</code> can be a callback function as well.</p>
<pre><code class="language-javascript">moment.updateLocale(&apos;en&apos;, {
    weekdays : function (momentToFormat, format) {
        return weekdays[momentToFormat.day()];
    }
});
</code></pre>
<p><strong>Note:</strong> From version <strong>2.11.0</strong> format/standalone cases can be passed as well. <code>isFormat</code> will be used against the full format string to determine which form to use.</p>
<pre><code class="language-javascript">moment.updateLocale(&apos;en&apos;, {
    weekdays : {
        standalone: &apos;&#x412;&#x43E;&#x441;&#x43A;&#x440;&#x435;&#x441;&#x435;&#x43D;&#x44C;&#x435;_&#x41F;&#x43E;&#x43D;&#x435;&#x434;&#x435;&#x43B;&#x44C;&#x43D;&#x438;&#x43A;_&#x412;&#x442;&#x43E;&#x440;&#x43D;&#x438;&#x43A;_&#x421;&#x440;&#x435;&#x434;&#x430;_&#x427;&#x435;&#x442;&#x432;&#x435;&#x440;&#x433;_&#x41F;&#x44F;&#x442;&#x43D;&#x438;&#x446;&#x430;_&#x421;&#x443;&#x431;&#x431;&#x43E;&#x442;&#x430;&apos;.split(&apos;_&apos;),
        format: &apos;&#x412;&#x43E;&#x441;&#x43A;&#x440;&#x435;&#x441;&#x435;&#x43D;&#x44C;&#x435;_&#x41F;&#x43E;&#x43D;&#x435;&#x434;&#x435;&#x43B;&#x44C;&#x43D;&#x438;&#x43A;_&#x412;&#x442;&#x43E;&#x440;&#x43D;&#x438;&#x43A;_&#x421;&#x440;&#x435;&#x434;&#x443;_&#x427;&#x435;&#x442;&#x432;&#x435;&#x440;&#x433;_&#x41F;&#x44F;&#x442;&#x43D;&#x438;&#x446;&#x443;_&#x421;&#x443;&#x431;&#x431;&#x43E;&#x442;&#x443;&apos;.split(&apos;_&apos;),
        isFormat: /\[ ?[&#x412;&#x432;] ?(?:&#x43F;&#x440;&#x43E;&#x448;&#x43B;&#x443;&#x44E;|&#x441;&#x43B;&#x435;&#x434;&#x443;&#x44E;&#x449;&#x443;&#x44E;|&#x44D;&#x442;&#x443;)? ?\] ?dddd/
    }
});
</code></pre>
					</div>
          <div></div>
        </div>
      </div>
    </div>
  </div>
  
  <script src="static/js/highlight.min.js"></script>
  <script src="static/js/javascript.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script>
  <script>var _hmt = _hmt || []; (function () { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?7a7f78c805fbacc7e075d34f153031aa"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();</script>

  <style>
    .hero-centered {
      margin: 0;
          margin-left: 10px;
    }
#gtoc ul {
  list-style: none;
  margin-left: 0;
  line-height: 1.5rem;
  padding: 0;
}
#gtoc>ul>li {
  display: inline;
  border-right: 1px solid #000;
  margin-right: .4rem;
  padding-right: .4rem;
}
#gtoc>ul>li>a {
  color: #61b2a7;
}
#content_left {
  width: 49%;float: left;border-right: 1px solid #eee;    padding-right: 2%;
}
#content_right {
float: left;width: 48%;margin-left: 3%;
}
#column1 {
  padding: 0 2rem;
}
  </style>


</body></html>